extern "C" {
    fn strlen(_: *const i8) -> u64;
}
pub type size_t = u64;
#[no_mangle]
pub extern "C" fn strlcat(mut dst: *mut i8, mut src: *const i8, mut siz: size_t) -> size_t {
    let mut d: *mut i8 = dst;
    let mut s: *const i8 = src;
    let mut n: size_t = siz;
    let mut dlen: size_t = 0;
    loop {
        let fresh0 = n;
        n = n.wrapping_sub(1);
        if !(fresh0 != 0 as i32 as u64 && (unsafe { *d }) as i32 != '\0' as i32) {
            break;
        }
        d = unsafe { d.offset(1) };
    }
    dlen = (unsafe { d.offset_from(dst) }) as i64 as size_t;
    n = siz.wrapping_sub(dlen);
    if n == 0 as i32 as u64 {
        return dlen.wrapping_add(unsafe { strlen(s) });
    }
    while (unsafe { *s }) as i32 != '\0' as i32 {
        if n != 1 as i32 as u64 {
            let fresh1 = d;
            d = unsafe { d.offset(1) };
            (unsafe { *fresh1 = *s });
            n = n.wrapping_sub(1);
        }
        s = unsafe { s.offset(1) };
    }
    (unsafe { *d = '\0' as i32 as i8 });
    return dlen.wrapping_add((unsafe { s.offset_from(src) }) as i64 as u64);
}
